//
//  ModifyApayVC.m
//  QuanJieShopProject
//
//  Created by SunChao on 2018/6/14.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "ModifyApayVC.h"

@interface ModifyApayVC ()
@property (weak, nonatomic) IBOutlet UITextField *apayNumLabel;
@property (weak, nonatomic) IBOutlet UITextField *realName;
@property (weak, nonatomic) IBOutlet UITextField *phoneNum;

@end

@implementation ModifyApayVC

- (void)viewDidLoad {
    [super viewDidLoad];
   
    self.title = @"绑定结算账号";
  
}



- (IBAction)submitAction:(UIButton *)sender {
    
    [self.apayNumLabel resignFirstResponder];
    [self.realName resignFirstResponder];
    [self.phoneNum resignFirstResponder];
    
    if (self.apayNumLabel.text == nil) {
        [MBPHUD showAlertWithTitle:@"请填写支付宝账号"];
        
        return;
    }
    if (self.realName.text == nil) {
        [MBPHUD showAlertWithTitle:@"请填写实名支付宝姓名"];
        
        return;
    }
    if (self.phoneNum.text == nil) {
        [MBPHUD showAlertWithTitle:@"请填写有效手机号码"];
        
        return;
    }
    
    NSMutableDictionary *params = [NSMutableDictionary dictionary];
    [params setObject:self.apayNumLabel.text  forKey:@"card_num"];
    [params setObject:self.realName.text forKey:@"user_name"];
    [params setObject:self.phoneNum.text forKey:@"mobile"];
    
    [WWNetRequest fetchOrderBindcardWithParameters:params success:^(id response) {
        

        if (response) {
            
             [MBPHUD showAlertWithTitle:@"提交成功,请等待后台审核"];
            
            [self.navigationController popViewControllerAnimated:YES];
            
        }
        
    } failure:^(NSDictionary *error) {
        
        
    }];
   
    
}

@end
